package com.buaa.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;

import java.time.LocalDateTime;

@Data
//可以使用 @TableName 表名注解指定当前实体类对应的表名，比如下面 User 实体类对应表名为 sys_user
@TableName(value="accident_scene_map")
public class AccidentSceneMap {
    //可以使用 @TableId 注解（标注在主键上）和 @TableField 注解（标注在其他成员属性上）来指定对应的字段名
    @TableId(value = "id",type = IdType.AUTO)
    private Integer id;

    @TableField(value = "accident_id")
    private String accidentId;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "arrive_time")
    private LocalDateTime arriveTime; //到达事故现场时间

    // 天气
    @TableField(value = "weather") // 天气
    private String weather;

    @TableField(value = "road_type") // 路面性质
    private String roadType;

    //userName 字段与数据库表字段 user_name 进行映射
    @TableField(value = "accident_location") //事故地点
    private String accidentLocation;

    @TableField(value = "accident_description") // 事故描述
    private String accidentDescription;

    @TableField(value = "accident_comments") // 事故说明
    private String accidentComments;

    @TableField(value = "surveyor") // 勘察员
    private String surveyor;

    @TableField(value = "draftsman") // 绘图员
    private String draftsman;

    @TableField(value = "party") //当事人
    private String party;

    @TableField(value = "witness") // 见证人
    private String witness;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "map_time") // 绘制时间
    private LocalDateTime mapTime;

    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "create_time")
    private LocalDateTime createTime;
    @TableField(value = "create_by")
    private String createBy;


    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @TableField(value = "revision_time")
    private LocalDateTime revisionTime;

    @TableField(value = "reviser")
    private String reviser;
}
